<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>欢迎注册</title>
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/login_register.css">
<style>
.loginMain {
	width: 400px;
	height: 300px;
	margin: 0 auto;
	margin-top: 50px;
}
</style>

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript">
	$(function() {
		$("#username").change(function() {
			$.ajax({
				url : "user",
				data : "username=" + $("#username").val() + "&action=query",
				type : "post",//post,get
				dataType : "text",//text,xml,text json
				success : function(data) {
					if (data.indexOf("true") > -1) {
						$("#msg").html("用户名已存在");
					} else {
						$("#msg").html("用户名可用");
					}
				}
			});
		});
	});
</script>
</head>
<body>
	<div class="navbar navbar-default" id="loginOrRegister">
		<div class="navbar-header">
			<span class="navbar-brand"> <span class="fa fa-paper-plane">
			</span> 学生学习行为管理系统
			</span>
		</div>
		<div class="navbar-collapse collapse" style="height: 1px;"></div>
	</div>

	<div class="loginMain">
		<div>
			<form action="user" method="post">
				<div class="form-group">
					<label>用户名</label> <input type="text" name="username" id="username"
						class="form-control span12"><span id="msg"></span>
				</div>
				<div class="form-group">
					<label>密码</label> <input type="password" name="password"
						class="form-control span12">
				</div>
				<input type="hidden" value="register" name="action" />
				<div class="form-group">
					<label>真实姓名</label> <input type="text" name="realname"
						class="form-control span12">
				</div>
				<div class="form-group">
					<label>手机号</label> <input type="text" name="phone"
						class="form-control span12">
				</div>
				<div class="form-group">
					<label>邮箱</label> <input type="text" name="email"
						class="form-control span12">
				</div>
				<div class="form-group">
					<input type="submit" class="btn btn-primary pull-right" value="注册" />
					<label class="remember-me"><input type="checkbox"
						required="required"> 同意 <a
						href="terms-and-conditions.html">所有管理条例</a></label>
				</div>
				<div class="clearfix"></div>
			</form>
		</div>
	</div>
</body>
</html>
